package com.example.good.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.good.entity.UserRolesDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UsersRolesMapper extends BaseMapper<UserRolesDO> {

    /**
     * 通过了用户id获取角色id
     * 
     * @param userId
     * @return 返回角色id列表
     */
    @Select("select roles_id from users_roles where users_id = #{userId}")
    List<Long> getRolesIdByUserId(Long userId);
}
